
package filmAction;

import PO.Stuinfo;
import filmsDao.StudentDao;

import com.opensymphony.xwork2.ActionSupport;
import javax.swing.JOptionPane;

public class UpdateMessageAction extends ActionSupport{
   
    private String message="input";
    private String id;
	private String name;
	private String star;
	private String type;
	private String time;
	private String maker;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getStar() {
		return star;
	}
	public void setStar(String star) {
		this.star = star;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}
	public String getMaker() {
		return maker;
	}
	public void setMaker(String maker) {
		this.maker = maker;
	}
	public void validate(){
        
    }
    public String execute() throws Exception{
        StudentDao dao=new StudentDao();
        boolean update=dao.updateInfo(info());
        if(update){
            message="success";
        }
        return message;
    }
    public Stuinfo info(){
        Stuinfo info=new Stuinfo();
        info.setId(this.getId());
        info.setName(this.getName());
        info.setStar(this.getStar());
        info.setType(this.getType());
        info.setTime(this.getTime());
        info.setMaker(this.getMaker());
        return info;
    }
    public void message(String mess){
        int type=JOptionPane.YES_NO_OPTION;
        String title="鎻愮ず淇℃伅";
        JOptionPane.showMessageDialog(null, mess, title, type);
    }
}
